<template>
  <div>
    <div>
      <el-divider class="divider" style="font-weight:900;width:80px;margin-top:0px" content-position="left">赛事记录</el-divider>
      <div>
        <el-table class="gl_table_noBorder" size="mini" :data="tableGameData">
          <el-table-column type="index" label="序号" align="center" width="55" />
          <el-table-column label="比赛日期">
            <template slot-scope="{ row }">
              <span v-if="row.competitionDate">
                {{ row.competitionDate | FormatDate('yyyy-MM-dd') }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="赛事名称" prop="competitionName" />
          <el-table-column label="代表机构" prop="delegationName" />
          <el-table-column label="参赛成绩" :min-width="140">
            <template slot-scope="{ row }">
              <div v-for="(item,index) in row.eventResults" :key="index">
                {{ item.eventLongDes + ' ' + '第' + item.rank + '名' }}
              </div>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <el-divider style="font-weight:900;width:80px" content-position="left">培训记录</el-divider>
      <div>
        <el-table class="gl_table_noBorder" size="mini" :data="tableTrainData">
          <el-table-column type="index" label="序号" align="center" width="55" />
          <el-table-column label="培训时间">
            <template slot-scope="{ row }">
              <span v-if="row.trainStartDate">
                {{ row.trainStartDate | FormatDate('yyyy-MM-dd') }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="培训名称" prop="trainName" />
          <el-table-column label="培训课程" prop="subjectName" />
          <el-table-column label="培训成绩" prop="scoreResult" />
        </el-table>
      </div>
      <el-divider style="font-weight:900;width:80px" content-position="left">级段位申报</el-divider>
      <div>
        <el-table class="gl_table_noBorder" size="mini" :data="tableDanData">
          <el-table-column type="index" label="序号" align="center" width="55" />
          <el-table-column label="考试时间">
            <template slot-scope="{ row }">
              <span v-if="row.examTime">
                {{ row.examTime | FormatDate('yyyy-MM-dd') }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="申报名称" prop="requestName" />
          <el-table-column label="所属机构" prop="organizationUnitName" />
          <el-table-column label="考试级别" prop="duans" align="center">
            <template slot-scope="{ row }">
              <span v-for="(item,index) in row.duans" :key="index">
                {{ item }} {{ row.duans.length > 0 ? row.duans.length - 1 === index ? '': '/' : '' }}
              </span>
            </template>
          </el-table-column>
          <el-table-column label="考试结果" align="center">
            <template slot-scope="{ row }">
              <span v-if="row.scoreStatusName">
                {{ row.scoreStatusName }}
              </span>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>

<script>
import { api_GET_ClubBranchBranchEntryScoreReusltStudentId, api_GET_ClubBranchBranchStudentDuanExamInfoStudentId, api_GET_ClubBranchBranchStudentCompetitionResultsStudentId } from '@/extend/api/hallswaggerApi/app.js';
export default {
  data() {
    return {
      tableGameData: [],
      tableTrainData: [],
      tableDanData: []
    };
  },
  created() {
    this.init();
  },
  methods: {
    init() {
      api_GET_ClubBranchBranchStudentCompetitionResultsStudentId(this.$route.query.id).then(res => {
        console.log(res);
        this.tableGameData = res;
      });
      api_GET_ClubBranchBranchEntryScoreReusltStudentId(this.$route.query.id).then(res => {
        console.log(res);
        this.tableTrainData = res;
      });
      api_GET_ClubBranchBranchStudentDuanExamInfoStudentId(this.$route.query.id).then(res => {
        console.log(res, 'sssssssss');
        this.tableDanData = res;
      });
    }
  }
};
</script>

<style lang="scss" scoped>
::v-deep .el-divider--horizontal:nth-of-type(1){
  margin-top: 8px;
}
</style>
